<%--
  Created by IntelliJ IDEA.
  User: 86187
  Date: 2021/10/21
  Time: 10:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="resource/bootstrap4/css/bootstrap.css">
    <script src="resource/js/jquery-3.2.1.js"></script>
    <script src="resource/bootstrap-treeview/js/bootstrap-treeview.js"></script>
    <script src="resource/bootstrap4/js/bootstrap.js"></script>
    <script src="resource/My97DatePicker/WdatePicker.js"></script>
    <title>增加</title>
<script>
    function deleteById(id){
        if(confirm("您确定要删除id为:"+id+"的数据吗?")){
            $.post(
                "/deleteById",
                {id:id},
                function (obj){
                    if(obj){
                        alert("删除成功");
                        location.reload();
                    }else{
                        alert("删除失败");
                    }
                }
            )
        }

    }
</script>
</head>
<body>
<form method="post" action="/add">
    品牌 :<input type="text" name="types">
    产品编号:<input type="text" readonly="readonly" value="${l}">
    发布时间:<input type="date" name="created"><br>
    主版本号:<input type="text" name="zvernum">
    从版本号:<input type="text" name="cvernum"><br>
    制作人:<input type="text" name="user.uname" value="${user.uname}">
    审核人:<input type="text" name="shr">
    总用量:<input type="text" readonly="readonly" name="zlose"><br>
    制图文件:<input type="text" name="ztpackage"><br>
    备注:<input type="text" name="mark">
    <table class="table table-striped">
        <thead>
        <tr>
            <th scope="col">生产阶段</th>
            <th scope="col">层级</th>
            <th scope="col">物料编号</th>
            <th scope="col">物料名称</th>
            <th scope="col">型号规格</th>
            <th scope="col">单位</th>
            <th scope="col">用量</th>
            <th scope="col">位置</th>
            <th scope="col">备注</th>
            <th scope="col">操作</th>
        </tr>
        </thead>
        <c:forEach items="${list}" var="a">
            <tbody>
            <tr>
                <td>${a.scjd}</td>
                <td>${a.cj}</td>
                <td>${a.wlid}</td>
                <td>${a.wlname}</td>
                <td>${a.xhgg}</td>
                <td>${a.unit}</td>
                <td>${a.lose}</td>
                <td>${a.location}</td>
                <td>${a.mark}</td>
                <td><a href="javascript:deleteById(${a.id})">删除</a></td>
            </tr>
            </tbody>
        </c:forEach>
    </table>
</form>
</form>

</body>
</html>